﻿package BasicData.Races{
	
	import BasicData.*;

	public class Eladrin implements CharRace {
		private var racename:String;
		private var abilitymods:Array;
		private var speed:int;
		private var visions:Array;
		private var languages:Array;
		private var skillbonuses:Array;
		private var weaponprofs:Array;
		private var others:Array;
		private var racialpowers:Array;
		function Eladrin(){
			racename = "Eladrin";
			abilitymods = new Array();
			abilitymods.push(new Modifier("Dex", "Dexterity", 2));
			abilitymods.push(new Modifier("Int", "Intelligence", 2));
			speed = 6;
			visions = new Array();
			visions.push("lowlight");
			languages = new Array();
			languages.push("common");
			languages.push("elven");
			skillbonuses = new Array();
			skillbonuses.push(new Modifier("Arcana", "Arcana", 2));
			weaponprofs = new Array();//todo: weapons
			others = new Array();//todo
			racialpowers = new Array();//todo: powers
		}
		public function getName():String {
			return racename;
		}
		public function getAbilityMod(ability:String):int {
			var i:int;
			for (i=0; i<abilitymods.length; i++){
				if (abilitymods[i].modtype.toLowerCase() == ability.toLowerCase() || abilitymods[i].moddesc.toLowerCase() == ability.toLowerCase()){
					return abilitymods[i].modvalue;
				}
			}
			return 0;
		}
		public function getSpeed():int {
			return speed;
		}
		public function getVisions():Array {
			return visions;
		}
		public function hasVision(vision:String):Boolean {
			var i:int;
			for (i=0; i<visions.length; i++){
				if (visions[i].toLowerCase() == vision.toLowerCase()){
					return true;
				}
			}
			return false;
		}
		public function getLanguages():Array {
			return languages
		}
		public function hasLanguage(lang:String):Boolean {
			var i:int;
			for (i=0; i<languages.length; i++){
				if (languages[i].toLowerCase() == lang.toLowerCase()){
					return true;
				}
			}
			return false;
		}
		public function getSkillBonuses():Array {
			return skillbonuses;
		}
		public function getSkillBonus(skill:String):int {
			var i:int;
			for (i=0; i<skillbonuses.length; i++){
				if (skillbonuses[i].modtype.toLowerCase() == skill.toLowerCase() || skillbonuses[i].moddesc.toLowerCase() == skill.toLowerCase()){
					return skillbonuses[i].modvalue;
				}
			}
			return 0;
		}
		public function getRacialPowers():Array {
			return null;
		}
		public function getRacialPower(power:String):void {
		}
		public function getOthers():Array {
			return others;
		}
	}
}